<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<LINK REL="stylesheet" HREF="../../templates/css/style.css" TYPE="text/css">
<LINK rel="stylesheet" href="../../templates/css/dialog.css" type="text/css">
<script language="javascript" src="../../templates/js/tab.js"></script>
<script language="javascript" type="text/javascript" src="../../lib/cate.js"></script>
<script language="javascript" type="text/javascript">
<!--
  var oTabs = new Object() ;
  
  function check_form()
  {
    var k = objSorts.childNodes.length;
	cur_num = k - 1;
    cur_list = document.getElementById("sel_" + cur_num);
	cur_value = cur_list.value;
	if (cate[cur_value] || cur_value == "")
	{
	  alert("請選擇分類!");
      SetSelectedTab("chinese");
	  return false;
	}
	
	obj = document.add_news.ch_headline;
	if( obj.value == "")
	{
	   alert("請至少輸入新聞標題");
	   SetSelectedTab("chinese");
	   return false;
	}
	obj_form = document.add_news;
	obj_form.cate_id.value = cur_value;
	obj.submit;
  } //End fun
  function init_cate()
  {
     {init_cate}
  }  
function AddMoreRow() 
{ 
    var oRow=event.srcElement.parentNode.parentNode; 
    var oTable=oRow.parentNode.parentNode; 
    oNewRow=oTable.insertRow(); 
    for(i=0;i<oRow.cells.length;i++) 
    { 
        oNewRow.insertCell().innerHTML=oRow.cells[i].innerHTML; 
    } 
    oRow.all("DelBtn").disabled=false; 
    oNewRow.all("DelBtn").disabled=false; 
} 
function DeleteMoreRow() 
{ 
    var oRow=event.srcElement.parentNode.parentNode; 
    var oTable=oRow.parentNode.parentNode; 
   if(oTable.rows.length>1) 
    { 
        oTable.deleteRow(oRow.rowIndex); 
        if(oTable.rows.length==1) 
        { 
           oTable.all("DelBtn").disabled=true; 
        } 
    } 
} 
function DisabledKeyInput() 
{ 
    if(event.keyCode!=8&&event.keyCode!=46) 
    { 
        event.returnValue=false; 
    } 
} 


//多图片上传代码
function add_inp(){ 
	newInp = document.createElement("input") 
	newInp.setAttribute("type","file") 
	newInp.setAttribute("name","upfile[]") 
	div1.appendChild(newInp) 
	newInp = document.createElement("br") 
	div1.appendChild(newInp) 
} 
function del_inp(){ 
	childlen=div1.childNodes.length 
	childlen-- 
	div1.removeChild(div1.childNodes[childlen]) 
	childlen-- 
	div1.removeChild(div1.childNodes[childlen]) 
} 
//-->
</script>
<table width="98%" border="0" class="table2">
  <tr>
    <td>管理中心 - 文章管理 - 編輯文章</td>
  </tr>
</table>
<form method="post" name="add_news" action="./modules/update_news.php" onsubmit="return check_form()" enctype="multipart/form-data" >
<table cellpadding=0 cellspacing=3 width=98% align="center" style="border:1px solid #A5ADC4">	  
<tr id="chinese">
<th colspan="2">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
  <td width="6%" align="right" ><b>分類: </b></td>
  <td width="94%"> {SHOW_CATE} </td>
</tr>
<tr>
  <td width="6%" align="right" ><b>標題: </b></td>
  <td width="94%"><input name="ch_headline" type="text" value="{ch_headline}" size='40' /></td>
</tr>
  <tr>
	<th width="6%" align="right">作者:</th>
	<td width="94%"><input name="ch_source" type="text" value="{ch_source}" size='40'/></td>
  </tr>
  <tr>
	<th width="6%" align="right">缩略图:</th>
	<td width="94%">{img}
	  <input type="file" name="img" /> 房產新聞,家具生活 有效: 200 * 150</td>
  </tr>

  <tr>
	<th align="right" valign="top">内容:</th>
	<td>{CHINESE_EDIT}</td>
  </tr>
  <td colspan="2"><div align="center">
  <input type="hidden" name="id" value="{id}" />
  <input type="hidden" name="cate_id" value="" />
  <input name="btn_sub" type="submit" id="btn_sub" value="確 定" class="bot" />
  <input name="reset" type="reset" id="reset" value="重 填" class="bot" />
  <input name="btn_ret" type="button" id="btn_ret" value="返 回" onclick="location.href='?action=news'" class="bot" />
    </div></td>
  </tr>
  </table>
  </th>
</tr>
<!--英文-->
<!--
<tr id="english">
<th colspan="2">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
  <td width="13%" align="right" ><b>英文标题: </b></td>
  <td width="88%"><input name="en_headline" type="text" value="{en_headline}" /></td>
</tr>
<tr>
	<th width="13%" align="right">英文来源:</th>
	<td width="88%"><input name="en_source" type="text" id="ZH" value="{en_source}" /></td>
</tr>
<tr>
	<th align="right" valign="top">英文内容:</th>
	<td>{ENGLISH_EDIT}</td>
</tr>
   <td colspan="2"><div align="center">
  <input type="hidden" name="cate_id" value="" /><input type="hidden" name="news_id" value="{news_id}" />
  <input name="btn_sub" type="submit" id="btn_sub" value="确 定" class="bot" />
  <input name="reset" type="reset" id="reset" value="重 填" class="bot" />
  <input name="btn_ret" type="button" id="btn_ret" value="返 回" onclick="location.href='?action=news'" class="bot" />
    </div></td>
  </tr>
  </table>
  </th>
</tr>-->
 </table>
</form>

<script type="text/javascript" language="javascript">
<!--
   init_cate();
//-->
<!--   
   AddTab("chinese", '文章资料', false );
   //AddTab("english", '英文资料', false ); 
   SetSelectedTab("chinese");
//-->
</script>
